<template>
  <view class="console-container">
    <EmptyTop />
    <Top />
    <ActionBox :options="actionOptions" />
  </view>
</template>

<script>
import { mapActions, mapGetters } from "vuex";
import EmptyTop from "../../components/public/EmptyTop/index.vue";
import Top from "./components/Top/index.vue";
import ActionBox from "./components/ActionBox/index.vue";
export default {
  components: { EmptyTop, Top, ActionBox },
  data() {
    return {
      search: {},
      actionOptions: [
        {
          name: "商品管理",
          link: "menus",
          image: "/static/images/index/caipinguanli@3x.png"
          // image: "/static/images/index/caipin.png"
        },
        {
          name: "桌台",
          link: "table",
          image: "/static/images/index/zhuotai3.png"
        },
        // {
        //   name: "数据分析",
        //   link: "menus",
        //   image: "/static/images/index/shuju-8@2x.png"
        // },
        {
          name: "打印机",
          link: "printer",
          image: "/static/images/index/dayinji@3x.png"
        },
        {
          name: "会员卡",
          link: "member",
          image: "/static/images/index/huiyuanqia-2@3x.png"
        },
        {
          name: "外送设置",
          link: "delivery",
          image: "/static/images/index/waimai-8@3x.png"
        }
      ]
    };
  },
  computed: {
    ...mapGetters({
      activeShop: "activeShop",
      homeData: "homeData"
    })
  },
  onPullDownRefresh() {
    this.init();
  },
  onShow() {
    // this.init();
  },
  methods: {
    ...mapActions({
      getHomeData: "getHomeData"
    }),
    init() {
      this.getHomeData().finally(res => {
        uni.stopPullDownRefresh();
      });
    }
  }
};
</script>

<style lang="scss" >
page {
  background-color: $uni-bg-color-grey;
}
// .console-container {
//   /* padding: 20px; */
//   /* font-size: 14px;
//   line-height: 24px; */
//   /* padding: 0 30rpx; */
// }
</style>
